package com.k.base.jdk.functions.demo2;

import java.util.function.Consumer;

public class Gen2 {
    private DataSourceConfig dataSourceConfig = new DataSourceConfig();
    private PackageConfig packageConfig = new PackageConfig();

    public Gen2 dataSourceConfig(Consumer<DataSourceConfig> consumer) {
        consumer.accept(this.dataSourceConfig);
        return this;
    }
    public Gen2 packageConfig(Consumer<PackageConfig> consumer) {
        consumer.accept(this.packageConfig);
        return this;
    }

    public void gen(){
        System.out.println("gen2 gen:");
        System.out.println("dataSourceConfig:"+dataSourceConfig);
        System.out.println("packageConfig:"+packageConfig);
    }

    public static Gen2 create(){
        return new Gen2();
    }
}
